package org.huang.spock.base

import spock.lang.Specification


//given … expect (when … then)…
//given … expect (when … then)… where...
//expect(when … then) … where...
//expect (when … then)…
class HelloSpockTest extends Specification {


    def "length of Spock's and his friends' names"() {
        expect:
        name.size() == length

        //每一行为一个case
        where:
        name     || length
        "Spock"  || 5
        "Kirk"   || 4
        "Scotty" || 6
    }


    def "length of Spock's and his friends' names2"() {
        expect:
        name.size() == length

        //每一列为一个case
        where:
        name << ["Spock", "Kirk", "Scotty"]
        length << [5, 4, 6]

    }
}